package cnpm02.j2ee.group3.model;

import javax.persistence.AttributeOverride;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Table;

import org.hibernate.validator.NotNull;

@Entity
@Table(name = "TICKET_TYPE")
@AttributeOverride(name = "id", column = @Column(name = "TicketTypeId"))
public class TicketType extends AbstractEntity implements Translatable {
	private static final long serialVersionUID = 1L;
	
	@NotNull
	@Enumerated(EnumType.STRING)
	@Column(name = "Code", nullable = false, length = 4, unique = true)
	private TicketTypeCodeEnum code;

	public TicketType() {
		super();
	}
	
	public TicketType(TicketTypeCodeEnum code) {
		this.code = code;
	}
	
	public void setCode(TicketTypeCodeEnum code) {
		this.code = code;
	}

	public TicketTypeCodeEnum getCode() {
		return code;
	}
}
